
const config = require("./dbConfig");
import { MysqlDataContext } from "tiny-entity2/mysql/dataContextMysql"
import { Account } from "./models/account"
import { AccountPermits } from "./models/accountPermits"
import { AccountRoles } from "./models/accountRoles"
import { AccountUserName } from "./models/accountUserName"
import { Componet } from "./models/componet"
import { Condition } from "./models/condition"
import { DataRegister } from "./models/dataRegister"
import { Department } from "./models/department"
import { FlowNode } from "./models/flowNode"
import { Organization } from "./models/organization"
import { OrganizationTree } from "./models/organizationTree"
import { OrgWorkflowItem } from "./models/orgWorkflowItem"
import { Page } from "./models/page"
import { Path } from "./models/path"
import { Role } from "./models/role"
import { Template } from "./models/template"
import { Token } from "./models/token"
import { User } from "./models/user"
import { Workflow } from "./models/workflow"
export class ApiDataContext extends MysqlDataContext {
    private account: Account;
    private accountPermits: AccountPermits;
    private accountRoles: AccountRoles;
    private accountUserName: AccountUserName;
    private componet: Componet;
    private condition: Condition;
    private dataRegister: DataRegister;
    private department: Department;
    private flowNode: FlowNode;
    private organization: Organization;
    private organizationTree: OrganizationTree;
    private orgWorkflowItem: OrgWorkflowItem;
    private page: Page;
    private path: Path;
    private role: Role;
    private template: Template;
    private token: Token;
    private user: User;
    private workflow: Workflow;
    constructor() {
        super(config);
        this.account = new Account(this);
        this.accountPermits = new AccountPermits(this);
        this.accountRoles = new AccountRoles(this);
        this.accountUserName = new AccountUserName(this);
        this.componet = new Componet(this);
        this.condition = new Condition(this);
        this.dataRegister = new DataRegister(this);
        this.department = new Department(this);
        this.flowNode = new FlowNode(this);
        this.organization = new Organization(this);
        this.organizationTree = new OrganizationTree(this);
        this.orgWorkflowItem = new OrgWorkflowItem(this);
        this.page = new Page(this);
        this.path = new Path(this);
        this.role = new Role(this);
        this.template = new Template(this);
        this.token = new Token(this);
        this.user = new User(this);
        this.workflow = new Workflow(this);
    }
    get Account() { return this.account; }
    get AccountPermits() { return this.accountPermits; }
    get AccountRoles() { return this.accountRoles; }
    get AccountUserName() { return this.accountUserName; }
    get Componet() { return this.componet; }
    get Condition() { return this.condition; }
    get DataRegister() { return this.dataRegister; }
    get Department() { return this.department; }
    get FlowNode() { return this.flowNode; }
    get Organization() { return this.organization; }
    get OrganizationTree() { return this.organizationTree; }
    get OrgWorkflowItem() { return this.orgWorkflowItem; }
    get Page() { return this.page; }
    get Path() { return this.path; }
    get Role() { return this.role; }
    get Template() { return this.template; }
    get Token() { return this.token; }
    get User() { return this.user; }
    get Workflow() { return this.workflow; }
    async CreateDatabase() {
        await super.CreateDatabase();
        await super.CreateTable(this.account);
        await super.CreateTable(this.accountPermits);
        await super.CreateTable(this.accountRoles);
        await super.CreateTable(this.accountUserName);
        await super.CreateTable(this.componet);
        await super.CreateTable(this.condition);
        await super.CreateTable(this.dataRegister);
        await super.CreateTable(this.department);
        await super.CreateTable(this.flowNode);
        await super.CreateTable(this.organization);
        await super.CreateTable(this.organizationTree);
        await super.CreateTable(this.orgWorkflowItem);
        await super.CreateTable(this.page);
        await super.CreateTable(this.path);
        await super.CreateTable(this.role);
        await super.CreateTable(this.template);
        await super.CreateTable(this.token);
        await super.CreateTable(this.user);
        await super.CreateTable(this.workflow);
        return true;
    }

    GetEntityObjectList() {
        return [this.account, this.accountPermits, this.accountRoles, this.accountUserName, this.componet, this.condition, this.dataRegister, this.department, this.flowNode, this.organization, this.organizationTree, this.orgWorkflowItem, this.page, this.path, this.role, this.template, this.token, this.user, this.workflow];
    }
}
